package com.zp.crm.dto.Kh;

import java.util.List;
import com.zp.crm.entity.KhEntity.KhEntity;

public class KhDto {
	
	
	public String Html(int count, List<KhEntity> list,int page,int inputI){
		//SimpleDateFormat f=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
		
		String b=null;
		
		StringBuffer a=new StringBuffer();
		
		int bh=0;
		
		for(KhEntity kh : list){
			
			bh++;
			
			a.append("<tr><td>"+bh+"</td><td>"+kh.getCode()+"</td><td>"+kh.getCrmName()+"</td><td>"+kh.getCrmdq()+"</td><td>"+kh.getCrmusername()+"</td><td>"+kh.getCrmdj()+"</td>");
			
			a.append("<td><a class='inner_btn CustomerSelectButtonEdit'>编辑</a><a class='inner_btn CustomerSelectButtonLXR'>联系人</a><a class='inner_btn CustomerSelectButtonJWJL'>交往记录</a><a class='inner_btn CustomerSelectButtonDelete'>删除</a></td>");
			
			a.append("</tr>");
			
		}
		
		if(list.size()==0){
			
			a.append("<tr><td style='text-align:center ;'colspan='8'>暂无查询信息</td></tr>");
		}
		
		a.append("</table>");
	
		int c=count/10;
		
		int o=count%10;
		
		if(c==0 || o>0){
			c=c+1;
		}
		
		page=page+1;
		
		a.append("<aside class='paging'>");
		
		a.append("<span class=''>当前第"+page+"页</span>");
		
		a.append("<input type='hidden' id='AInputPage' value='"+page+"'/>");
		
		if(inputI==0){
			a.append("<input type='hidden' id='CreateTypeInputHidden' value='"+inputI+"'/>");
		}else{
			a.append("<input type='hidden' id='CreateTypeInputHidden' value='"+inputI+"'/>");
		}
		
		a.append("<span class=''>共有"+c+"页</span>");
		
		if(c==0||c==1){
			a.append("<a class='PageIndexA'>1</a>");
		}else{ 
			int p=c+1;
			for(int i=1;i<p;i++){
				a.append("<a class='PageIndexA'>"+i+"</a>");
			};
		}	
		a.append("</aside>");	
		b=a.toString();
		return b;
	}

}
